package easy.id_101_200;

import javax.xml.transform.stream.StreamResult;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class lee168 {
    public static void main(String[] args) {
        System.out.println(convertToTitle(27));
        int a=26;
        char c = (char) ('A' + (a - 1));
        System.out.println(c);
    }

    public static String convertToTitle(int columnNumber) {
        String result="";
        StringBuffer sb=new StringBuffer(result);
        while(columnNumber>0){
            int current=(columnNumber-1)%26;
            columnNumber=(columnNumber-1)/26;
            char character;
            character= (char) ('A'+current);
            sb.append(character);
        }
        return sb.reverse().toString();

    }
}
